Lien0000342014-08-23
UNIX provides two functions DUP and dup2 for copying an existing file descriptor.
# Include
Int DUP (INT filedes );
Int dup2 (INT filedes, int filedes2 );
Returned value: If successful, a new file descriptor is returned. If an error occurs,-1 is returned.
The
For the DUP and fork functions, the former copies a file descriptor, which is the copy process, and the associated file information is copied.First, for the DUPAs already known, for a process, there is a files_struct to manage all the relevant files, the final reaction form is actually an array of files:The so-called file
need to pass the file descriptor as a parameter to the corresponding function.
Generally, when a process starts, three files are opened: standard input, standard output, and standard error handling. These three files correspond to the file descriptors 0, 1, and 2 respectively, that is, replacing stdin_fileno, stdout_fileno, and stderr_fileno with macros, encouraging readers to use these macros ).
Check th
1. DUP functionThe 1.1 DUP function is used to copy a file descriptor , and the copied file descriptor can be used normally (see Example 1). The DUP function returns one of the smallest available file descriptors in the current
This article was reproduced from: http://blog.csdn.net/tennysonsky/article/details/45870459DUP () and dup2 () are two very useful system calls that are used to copy the descriptor of a file so that the new file descriptor also identifies the file identified by the old file descriptor.This process is similar to the real
DUP () and dup2 () are two very useful system calls that are used to copy the descriptor of a file so that the new file descriptor also identifies the file identified by the old file descriptor.This process is similar to the real life of the key, the key equivalent to the
1dup functions and dup2 function#include int dup (INTOLDFD);int dup2 (INTOLDFD, int newfd);DUPand thedup2can be used to copy an existing file descriptor so that two file descriptors point to the samefilestructural body. If two file descriptors point to the samefilestructure,File
today, I installed Git on my own computer , no Chengxiang running error:
re-installed a few times git, no, no on the computer, the GitHub desktop version is not installed;
Later on the Internet to find the method, reflecting this is the problem of the system:
NULL is a special system file that actually provides a virtual device for the operating system, and the driver for this search device is c:windows\system32\drivers\NUll.sysSo
Today, suddenly found that git can not do anything, reported the above error, a variety of Baidu Google has not been resolved the solution. I re-installed git, restarting the computer is still not resolved, it is not the problem of git software, but a system problem.Null is a special system file that actually provides a virtual device for the operating system, and the driver for this search device is C:windows\system32\drivers\null.sysSolution:Take Wi
For local, we can use Windows with the lookup to find, but for online, such as looking for FTP space inside the file, this program is very useful.Use effect:
PHP file Finder source code:
Copy Code code as follows:
/*
* Note: Case sensitive
* By:http://www.jb51.net
*/
if (!empty ($_post[' path ')) !empty ($_post[' key ')) {
echo "in Path". $_pos
Searching for a file is simple. As long as you enter a directory, We will automatically traverse the directory and find the associated file name. Let's take a look at it.
PHP file lookup program. After a path is entered, all the files and folders under the directory will be traversed, and each file under the folder can
command:7za a -m0=LZMA2 -r -x\!.* archive.7z [StuffToArchive]Explanation of the command parameters:
a
Add to Compressed Package
-m0=LZMA2
Compression algorithms and options, where you specify a LZMA2 algorithm with high speed and fast compression rate
-r
Include Subdirectories and content
-x\!.*
Exclude hidden files under Mac, where the exclamation point represents the use of wildcar
When we view a file using the Finder in the Mac system, we do not display file information such as image size, number of items in the folder, length of the music file, and so on. This has caused some trouble to our use. So. How do I get the Finder to display the
Searching for a file is simple. As long as you enter a directory, We will automatically traverse the directory and find the associated file name. Let's take a look at it. Searching for a file is simple. As long as you enter a directory, We will automatically traverse the directory and find the associated file name. Let
Php file lookup program. After a path is entered, all the files and folders under the directory will be traversed, and each file under the folder can be found recursively, and then matched with the entered keyword through the file name, you can find the desired file. For local systems, we can use the search provided by
文件误删除是很常见的数据恢复故障。在文件误删除后如何恢复数据就显的尤为重要了,首先我们需要明白,在文件误删除后不能往要恢复的误删文件所在的分区,存入任何新的文件,否则数据覆盖了就无力回天了。接下来我们还需要了解下具体如何恢复文件误删除的文件,具体请看正文了解。Tools/Software: AuroradatarecoveryStep 1: First download and unzip the program to run, directly double-click the partition you need to restore, and then right-click the software icon Select "Run as Administrator"Step 2: After the program runs, directly double-click the partition you want to recoverStep 3: Wait for the program to complete the scan, usually takes a few
PHP file lookup program. After a path is entered, all the files and folders under the directory will be traversed, and each file under the folder can be found recursively, and then matched with the entered keyword through the file name, you can find the files you want. For local files, we can use the windows Search. However, for online files, such as files in the
For the local, we can take advantage of the Windows own find to find out, but for the online, such as the search FTP space inside the file, this program is very useful.
Use effect:
PHP file Finder Source:Copy the Code code as follows:
PHP Version File Search
/** Note: Case sensitive* By:http://www.jb51.net*/i
For the local, we can take advantage of the Windows own find to find out, but for the online, such as the search FTP space inside the file, this program is very useful.
Use effect:
PHP file Finder Source:Copy the Code code as follows:
PHP Version File Search
/** Note: Case sensitive* By:http://www.php.net*/if
For local systems, we can use the search provided by windows for search. However, for online systems, such as searching for files in the ftp space, this program is very useful.Effect:
PHP file finder source code:Copy codeThe Code is as follows:/** Note: Case Sensitive* By: http://www.jb51.net*/If (! Empty ($ _ POST ['path']) ! Empty ($ _ POST ['key']) {Echo "in path ". $ _ POST ['path']. "/In Search ". $ _
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.